package main;
import java.util.List;

import creator.CodeCreator;
import creator.DaoCreator;
import creator.ObjectInfo;
import creator.ServiceCreator;
import creator.XmlReader;

public class Main {
	public static final String DIR = "D:/codes/create/";
	public static final String FILE_NAME = "./src/main/resources/ClassesData.xml";

	public static void main(String[] args) {
		CodeCreator.createDir(DIR);
		XmlReader xmlReader = new XmlReader(FILE_NAME);
		xmlReader.lookupStart();
		List<ObjectInfo> objects = xmlReader.getObjects();

		for (ObjectInfo o : objects) {
			o.showObjectInfo();
			CodeCreator.createSimpleJavaFile(DIR, o);
			DaoCreator.createFile(DIR, o);
			ServiceCreator.createFile(DIR, o);
		}
	}
}
